import gtk
import sys

class GladeWidget:
    def __init__(self, widgetName):
        prj = "glade/gui.glade"
        try:
            self.widgets = gtk.glade.XML(prj, widgetName)
        except:
            print("An error occurred while loading glade project file, maybe it doesn't exist?")
            sys.exit(1)

    def __getitem__(self, key):
        return self.widgets.get_widget(key)
